<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
<ui:composition template="/view/public/main.xhtml">
	<ui:define name="content">
		<p:panel header="#{bundle.cadastrodeuser}">
			<h:form>
				<h:messages />
				<p:panelGrid columns="2">
					<p:outputLabel value="#{bundle.name}" for="name" />
					<p:inputText id="name" label="Nome"
						value="#{userController.user.name}" required="true" size="50"
						maxlength="30" requiredMessage="Campo Obrigatorio:Nome*" />

					<p:outputLabel value="#{bundle.password}" for="password" />
					<p:password id="password" label="Senha"
						value="#{userController.user.password}" required="true" size="50"
						maxlength="6" requiredMessage="Campo Obrigatorio:Senha*" />


					<p:outputLabel value="#{bundle.email}" for="email" />
					<p:inputText id="email" label="e-Mail"
						value="#{userController.user.email}" required="true" size="50"
						maxlength="50" requiredMessage="Campo Obrigatorio:E-mail*" />

					<p:outputLabel value="#{bundle.profile}" for="profile" />
					<p:selectOneMenu id="profile"
						value="#{userController.user.profile}"
						requiredMessage="Campo Obrigatorio:Perfil*">
						<f:selectItem itemLabel="Administrador" itemValue="Administrador" />
						<f:selectItem itemLabel="Fornecedor" itemValue="Fornecedor" />
					</p:selectOneMenu>

					<p:outputLabel value="#{bundle.numberRegistration}" for="numberRegistration" />
					<p:inputMask id="numberRegistration" label="CPF"
						value="#{userController.user.numberRegistration}" required="true"
						size="50" maxlength="50" requiredMessage="Campo Obrigatorio:CPF*"
						mask="999.999.999-99"/>

					<p:outputLabel value="#{bundle.telephone}" for="telephone" />
					<p:inputMask id="telephone" label="Telefone"
						value="#{userController.user.telephone}" required="true" size="50"
						maxlength="50" requiredMessage="Campo Obrigatorio:Telefone*"
						 mask="(999)9999-99999"/>

					<h:outputText />
					<h:commandButton action="#{userController.addUser()}"
						value="#{bundle.buttoninserir}" />
				</p:panelGrid>
			</h:form>
		</p:panel>
	</ui:define>
</ui:composition>
</html>